//
//  TableHeadVew.m
//  BakeCenter
//
//  Created by lanou3g on 15/9/22.
//  Copyright (c) 2015年 Baked. All rights reserved.
//

#import "TableHeadVew.h"

@implementation TableHeadVew
- (instancetype)initWithFrame:(CGRect)frame
{
    self = [super initWithFrame:frame];
    if (self) {
        
        self.backgroundColor = [UIColor colorWithWhite:0.9 alpha:1];

        UIImageView* animatedImageView = [[UIImageView alloc] initWithFrame:CGRectMake(0, 0, kScreenWidth, 100)];
        
        NSMutableArray *imagearr = [NSMutableArray array];
        for (int i = 1; i < 25; i ++) {
            UIImage *image = [UIImage imageNamed:[NSString stringWithFormat:@"image%d.tiff",i]];
            [imagearr addObject:image];
        }
        animatedImageView.animationImages = imagearr;
        
        animatedImageView.animationDuration = 2;
        
        animatedImageView.animationRepeatCount = 0;
        
        [animatedImageView startAnimating];
        
        [self addSubview: animatedImageView];
        
        
        self.sectionTitle = [[UILabel alloc] init];
        //        self.sectionTitle.backgroundColor = [UIColor redColor];
        [animatedImageView addSubview:self.sectionTitle];
        [self.sectionTitle mas_makeConstraints:^(MASConstraintMaker *make) {
            make.left.equalTo(animatedImageView.mas_left).offset(70);
            make.top.equalTo(animatedImageView.mas_top).offset(5);
            make.bottom.equalTo(animatedImageView.mas_bottom).offset(-5);
            make.width.mas_equalTo(@100);
        }];
        self.sectionTitle.textColor = [UIColor waveColor];
        self.sectionTitle.font = [UIFont boldSystemFontOfSize:15];
        
        
        
    }
    
    return self;
}
/*
// Only override drawRect: if you perform custom drawing.
// An empty implementation adversely affects performance during animation.
- (void)drawRect:(CGRect)rect {
    // Drawing code
}
*/

@end
